home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / FSEEK.HDR < prev    next >
Text File  |  1994-04-25  |  2KB  |  70 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _FSeek( xValue, cUDFFound, cUDFNFound ) -->lFound
  8.  
  9. PARAMETERS:
  10.  
  11. xValue : A value of any type to be SEEKed
  12.  
  13. SHORT:
  14.  
  15. SEEK without moving record pointer if value not found.
  16.  
  17. DESCRIPTION:
  18.  
  19. _FSeek() is functionally similar to Clippers SEEK command, but differs in
  20. that _FSeek() does not move the record pointer if the record is not found.
  21. If the record pointer is found, the record pointer is moved to the new
  22. record.
  23.  
  24. Additionally, two optional parameters may be passed containing the names
  25. of functions to be executed if the seek succeeds or fails.  cUDFFound, as
  26. the name implies, if linked into the program, is executed if the SEEK value
  27. is found.  The same is true for the cUDFNFound parameter.
  28.  
  29. If either of the UDFs specified are not present at run time, nothing
  30. happens, and the function returns the FOUND() value of the SEEK.
  31.  
  32. NOTE:
  33.  
  34. The record pointer is returned to the original record BEFORE the cUDFNFound
  35. UDF is called!
  36.  
  37. If either of the UDFs specified are not present at run time, nothing happens,
  38. and the function returns the FOUND() (TRUE or FALSE) value of the SEEK.
  39.  
  40. EXAMPLE:
  41.  
  42. GOTO nRec
  43. ? recno()        // 14583
  44.  
  45. SEEK cNoFind
  46.  
  47. ? found()        // .f.
  48. ? eof()          // .t.
  49. ? recno()        // (last record+1)
  50.  
  51. GOTO nRec
  52.  
  53. ? recno()        // 14583
  54.  
  55. _FSeek(cNoFind)
  56.  
  57. ? found()        // .f.
  58. ? eof()          // .f.
  59. ? recno()        // 14583
  60.  
  61.  
  62. _FSeek(nVal,"WhatToDoIfFound('Yep')","WhatToDoIfNOTFound('Nope')")
  63.  
  64. Result: nVal is SEEKed on the current index.  If FOUND(), then
  65. WhatToDoIfFound('Yep') is called (if present), else the record pointer is
  66. returned to the original record and WhatToDoIfNOTFound('Nope') is called (if
  67. present).
  68.  
  69. ******************************************************************************/
  70.